import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
import Topic from '../components/Topic.vue'
import Goods from '../components/Goods.vue'
import User from '../components/User.vue'
import News from '../components/News.vue'
import Count from '../components/Count.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: Login },
  {
    path: '/home',
    component: Home,
    children: [
      { path: '/', redirect: '/count' },
      { path: '/count', component: Count, name: '1' },
      { path: '/topic', component: Topic, name: '2' },
      { path: '/goods', component: Goods, name: '3' },
      { path: '/user', component: User, name: '4' },
      { path: '/news', component: News, name: '5' }
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
